package simorg.domain;

import org.dom4j.Element;

import simorg.util.StringUtil;

public class Compound {

	private int id;
	private String label;
	private String className;
	private float boilingPoint = 0;
	private float meltingPoint = 0;
	
	public Compound() {
		id = -1;
		label = "";
		className = "acid";
		
	}
	
	public float getBoilingPoint() {
		return boilingPoint;
	}

	public void setBoilingPoint(float boilingPoint) {
		this.boilingPoint = boilingPoint;
	}

	public float getMeltingPoint() {
		return meltingPoint;
	}

	public void setMeltingPoint(float meltingPoint) {
		this.meltingPoint = meltingPoint;
	}

	public Compound(String label) {
		this.id = -1;
		this.label = label;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}
	
	public void buildDomainXml(Element root) {
		Element compound = root.addElement("compound");
		compound.addAttribute("id", String.valueOf(this.getId()));
		Element label = compound.addElement("label");
		label.setText(StringUtil.nullSafe(this.getLabel()));
		Element classElement = compound.addElement("class");
		classElement.setText(StringUtil.nullSafe(this.getClassName()));
		return;
	}

	public String getClassName() {
		return className;
	}

	public void setClassName(String className) {
		this.className = className;
	}
	
	
}
